package com.huoyun.base.service;

import java.util.List;

import com.huoyun.base.bean.NodeInfo;
import com.huoyun.base.dao.NodeInfoDao;

public class NodeInfoServiceImpl implements NodeInfoService {

	private NodeInfoDao nodeInfoDao;

	@Override
	public int saveNodeInfo(final NodeInfo nodeInfo) {
		return nodeInfoDao.saveNodeInfo(nodeInfo);
	}

	@Override
	public void update(final NodeInfo nodeInfo) {
		nodeInfoDao.update(nodeInfo);
	}

	@Override
	public List<NodeInfo> getNodeInfosByParentId(final int parentId) {
		return nodeInfoDao.getNodeInfosByParentId(parentId);
	}

	@Override
	public NodeInfo getNodeInfoById(final int nodeId) {
		return nodeInfoDao.getNodeInfoById(nodeId);
	}

	@Override
	public void delete(final int nodeId) {
		nodeInfoDao.delete(nodeId);
	}

	@Override
	public List<NodeInfo> getTopNodesByMode(final String modeName) {
		return nodeInfoDao.getTopNodesByMode(modeName);
	}

	public NodeInfoDao getNodeInfoDao() {
		return nodeInfoDao;
	}

	public void setNodeInfoDao(final NodeInfoDao nodeInfoDao) {
		this.nodeInfoDao = nodeInfoDao;
	}

	@Override
	public List<NodeInfo> getAllNodeInfos() {
		return nodeInfoDao.getAllNodeInfos();
	}

}
